import { defHttp } from '/@/utils/http/axios';
import type { 
  TechnologyItem, 
  TrendQueryResult 
} from './TrendAnalysis.data';

enum Api {
  GetAllTechnologyList = '/analysis/trend/getAllTechnologyList',
  GetTechnologyTrend = '/analysis/trend/getTechnologyTrend',
}

/**
 * 获取所有技术分类列表
 */
export const getAllTechnologyList = () => {
  return defHttp.get<TechnologyItem[]>({
    url: Api.GetAllTechnologyList,
  });
};

/**
 * 获取技术申请趋势数据
 * @param params 查询参数
 */
export const getTechnologyTrend = (params: {
  technologyIds: string[];
  startYear: number;
  endYear: number;
}) => {
  return defHttp.post<TrendQueryResult>({
    url: Api.GetTechnologyTrend,
    data: params,
  });
};
